class Solution {
public:
    bool static compare(int a, int b)
    {
        return (to_string(a) + to_string(b)) > (to_string(b) + to_string(a));
    }

    bool operator()(int a, int b)
    {
        return (to_string(a) + to_string(b)) > (to_string(b) + to_string(a));
    }

    string largestNumber(vector<int>& nums) 
    {
        sort(nums.begin(), nums.end(),Solution());
        //sort(nums.begin(), nums.end(),compare);

        string s;
        for(auto e : nums)
        {
            s += to_string(e);
        }

        if(s[0] == '0')
            return "0";

        return s;
    }
};